home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 19
/
Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso
/
Aminet
/
comm
/
www
/
GetHistoryENG.lha
/
GetHistoryITA.ibrx
< prev
Wrap
Text File
|
1997-04-23
|
4KB
|
143 lines
/*
$VER: GetHISTORY 1.0 by Giuseppe Mammano
mammano@infoservizi.it
*/
lf = '0a'x
cr = '0d'x
file = 'globalhistory' /*Modificare il PATH, se necessario... Inputfile*/
tmpfile= 'ram:global.html' /*Contiene la lista da caricare... OutputFile*/
if ~show('l','rexxreqtools.library') then
if ~addlib('rexxreqtools.library',0,-30,0) then do
say "Couldn't find rexxreqtools.library"
exit
end
options results
dat = date()
parse var dat giorno mese anno
dag = left(date('W', date(S), 'S'), 3)
datum = dag mese giorno time() anno
salva=0
if ~open(temp,file,'r') then call ERRORE1(file) else
do
msg = readch(temp,2097152) /* max size = 2MB, aumentalo se necessario */
msg = translate(msg, 'hpt', 'HPT') /* minuscolo */
check = pos('ttp://', msg)
if check = 0 then do
rtezrequest('Non trovo nessun URL.', '_Ok', 'GlobalHistory'),"rt_pubscrname=ibrowseBR")
exit
end
close(temp)
rtezrequest('Carico la GlobalHistory come pagina HTML?', '_Si|_No', 'GlobalHistory',"rt_pubscrname=ibrowseBR")
if rtresult == 1 then salva=1
if check ~=0 then
do
open(temp, file, 'r')
if salva==1 then CALL salvaHeader
do while ~eof(temp)
msg = readln(temp)
msg = translate(msg, 'hpt', 'HPT')
parse var msg . 'ttp://' httpadres .
if httpadres ~= '' then
do
if right(httpadres,1) == '/' | right(httpadres,4)='html' | right(httpadres,3)='htm' then
do
lengte = length(httpadres)
call filter(httpadres, lengte)
if salva == 1 then call salvaURL
else
do
vraag = center(' Carico questo URL? ',lengte2,'-')
httpadres = rtgetstring(httpadres,vraag,'GlobalHistory','_Carica+Prossimo|Carica+_Smetti|P_rossimo|_Annulla',"rt_pubscrname=ibrowseBR")
if show('P','IBROWSE') then
do
if rtresult == 1 | rtresult == 2 then
do
address 'IBROWSE'
GOTOURL '"'httpadres'"'
end /*primo*/
else
if rtresult == 2 | rtresult == 0 then exit
end /*secondo*/
end /*terzo*/
end /*quarto*/
end /*ciclo di lettura URL esce qui*/
end /*terzultimo*/
if rtresult == 0 then exit
end /*penultimo*/
close(temp)
if salva==1 then call SalvaCoda
rtezrequest('Lista terminata!', '_Ok', 'GLobalHistory',"rt_pubscrname=ibrowseBR")
if salva == 1 & show('P','IBROWSE') then
do
address 'IBROWSE'
GOTOURL '"file:///'tmpfile'"'
call close(http)
end
exit
end /*ultimo*/
filter:
adres = arg(1)
lngth = arg(2)
lnfd = pos(lf, adres)
if lnfd ~=0 then do
adres = delstr(adres, lnfd)
end
cret = pos(cr, adres)
if cret ~=0 then do
adres = delstr(adres, cret)
end
punt = lastpos('.', adres)
if punt ~=0 then lngth = length(adres)
if (punt = lngth) then do
adres = delstr(adres, punt)
end
haak = lastpos(')', adres)
if haak ~=0 then do
adres = delstr(adres, haak)
end
komma = pos(',', adres)
if komma ~= 0 then do
adres = delstr(adres, komma)
end
quote = pos("'", adres)
if quote ~= 0 then do
adres = delstr(adres, quote)
end
dquote = pos('"', adres)
if dquote ~= 0 then do
adres = delstr(adres, dquote)
end
httpadres = 'http://'||adres
lengte2 = length(httpadres)
return
ERRORE1:
ARG file
SAY 'Errore!!'
SAY 'Non è possibile aprire il file 'file''
EXIT
SalvaHeader:
rtezrequest('Quest''operazione può durare qualche minuto: Continuo?', '_Si|_No', 'GlobalHistory',"rt_pubscrname=ibrowseBR")
if rtresult == 1 then do
open(dummy,tmpfile,'w')
call writeln dummy,'<!-- IBrowse GlobalHistory 'datum' -->'cr'<HTML>'cr'<HEAD><TITLE>IBrowse Hotlist 'datum' </TITLE></HEAD>'cr'<BODY>'cr'<H2><P ALIGN=CENTER>IBrowse GlobalHistory</P></H2>'cr'<HR>'cr'<UL>'
end
else salva=0
return
SalvaURL:
call writeln dummy,'<LI><A HREF="'httpadres'">'httpadres'</A>'
return
SalvaCoda:
call writeln dummy,'<HR>'cr'<P align=center><font size=-1>This list has been created using <A HREF="http://www.omnipresence.com/IBrowse/">IBrowse 1.1</A>.</font></P></BODY>'cr'</HTML>'
close(dummy)
return